<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #outer{
            width: 600px;
            height: 400px;
            background: lightblue;
            margin: 0px auto;
            position: absolute;
        }

        #inner{
            width: 100%;
            height: auto;
            background: lightpink;
            margin-top: 50%;
            /*给人一种错觉好像是外层盒子高度的50%，那么也就是200px*/
            position: relative;
        }
    </style>
</head>
<body>
<h1>margin的理解</h1>
<hr>

<div id="outer">

    <div id="inner">
        <br><br><br><br>
    </div>
</div>
</body>
</html>